package com.wu.apiorderaddfeign.service.Feign;

import com.wu.apiorderaddfeign.service.fallback.OrderAddClientFallback;
import com.wu.beans.Oreders;
import com.wu.vo.Reultvo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "order-add",fallback = OrderAddClientFallback.class)
public interface OrderAddClient {
    //在Feign客户端的⽅法中，如果不指定参数的传值⽅式，则默认为body传参，Get请求也 不例外；因此对于get请求传递参数，必须通过@RequestParam注解声明

//    @PostMapping("order/add")
//    public Reultvo addOrder(Oreders order);

    // 多个参数传递

    @PostMapping("order/add")
    public Reultvo addOrder(Oreders order, @RequestParam("str") String str);

    @GetMapping("order/get")
    public Oreders addOrder(@RequestParam("orderId")String orderId);

}
